package com.ostrich.demomvvm.ui.banner

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import com.ostrich.demomvvm.R
import com.ostrich.demomvvm.databinding.ActivityBannerBinding
import com.ostrich.demomvvm.mvvm.BaseMvvmActivity

class BannerActivity:BaseMvvmActivity<BannerViewModel, ActivityBannerBinding>() {
    override fun bindLayout(): Int {
        return R.layout.activity_banner
    }

    override fun initView() {

    }

    override fun initData() {
        viewModel.banner().observe(this){
            if(it.code == 200){
                val data = it.data
                Log.d("ytx", "轮播图数据: $data")
            }
        }
    }

    override fun initListener() {

    }

    override fun getJVMClass(): Class<BannerViewModel> {
        return BannerViewModel::class.java
    }

}